package com.jsb.laundry.model.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.Date;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Accessors(chain = true)
@ApiModel(value = "用户订单列表", description = "用户订单列表")
public class UserOrderList {
    @ApiModelProperty("订单id")
    private String orderId;
    @ApiModelProperty("原总价")
    private String originalPrice;
    @ApiModelProperty("实际支付金额")
    private String total;
    @ApiModelProperty("订单状态")
    private String orderStatus;

    @ApiModelProperty("商品图片")
    private String ordersImg;
    @ApiModelProperty("商品标题")
    private String ordersName;
    @ApiModelProperty("子订单数量")
    private String subOrderNumber;

    @ApiModelProperty("订单创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;
    @ApiModelProperty("订单支付超时时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date payTimeout;
    @ApiModelProperty("子订单信息")
    private List<ItemOrderInfo> itemOrderInfo;

    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Accessors(chain = true)
    @ApiModel(value = "子订单列表", description = "子订单列表信息")
    private static class ItemOrderInfo {
        @ApiModelProperty("订单id")
        private String subOrderId;
        @ApiModelProperty("商品id")
        private String productId;
        @ApiModelProperty("商品标题")
        private String title;
        @ApiModelProperty("商品图片")
        private String img;
        @ApiModelProperty("商品价格")
        private String price;
        @ApiModelProperty("商品数量")
        private String quantity;
        @ApiModelProperty("订单状态")
        private String subOrderStatus;
    }

}
